//
//  SEVoiceDelegate.swift
//  SmartEyeForPatient
//
//  Created by QDSG on 2021/5/6.
//

import Foundation

protocol SEVoiceRecordDelegate: class {
    /// 更新进度，0.0 - 9.0，浮点数
    func voiceRecordUpdateMetra(_ metra: Float)
    
    /// 录音太短
    func voiceRecordTooShort()
    
    /// 录音失败
    func voiceRecordFailed()
    
    /// 录音取消
    func voiceRecordCanceled()
    
    /// 录音完成
    /// - Parameters:
    ///   - uploadAmrData: 上传的 amr Data
    ///   - recordTime:    录音时长
    ///   - fileHash:      amr 音频数据的 MD5 值 (NSData)
    func voiceRecordFinished(_ uploadAmrData: Data, recordTime: Float, fileHash: String)
}

extension SEVoiceRecordDelegate {
    func voiceRecordCanceled() {}
}

protocol SEVoicePlayDelegate: class {
    /// 播放开始
    func voicePlayStart()

    /// 播放完毕
    func audioPlayFinished()
    
    /// 播放失败
    func voicePlayFailed()
    
    /// 播放被中断
    func audioPlayInterruption()
}
